package de.hwr.sudokuspielehr.io;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import org.junit.AfterClass;
import org.junit.Test;

/**
 * 
 * @author J. Reischauer
 * 
 */
public class TestWriter {
	private static File fileUnderTest = new File("TestWriterTestFile.txt");

	@Test
	public void test_write() throws IOException {
		assertFalse(fileUnderTest.exists());

		List<String> expected = Arrays.asList("Hello", "World");
		Writer.write(fileUnderTest, expected);

		List<String> actual = Reader.read(fileUnderTest);
		assertEquals(expected, actual);
	}

	@AfterClass
	public static void cleanUp() {
		fileUnderTest.delete();
	}
}
